{	Problem: http://codeforces.ru/problemset/problem/51/B
	Verdict: Accepted
}
uses sysutils,math;
var a,b:array[1..4] of int64; f:array[1..4] of boolean; r:int64; i,j:longint; s:string;
function q(n,m,k:longint):int64;
var i,j,p,t:longint;
begin
result:=1000000000000000;
f[n]:=true;
p:=a[m];
t:=a[n];
if s[k]='+' then inc(a[m],a[n]) else a[m]:=a[m]*a[n];
if k=3 then begin
  for i:=1 to 4 do
    if not f[i] then result:=a[i];
end else begin
for i:=1 to 3 do
  for j:=i+1 to 4 do
    if (not f[i]) and (not f[j]) then result:=min(result,q(i,j,k+1));
end;
if result=6 then begin
  f[n]:=false;
end;
f[n]:=false;
a[m]:=p;
a[n]:=t;
end;
begin
for i:=1 to 4 do read(a[i]);
readln;
readln(s);
delete(s,2,1);
delete(s,3,1);
r:=1000000000000000;
b:=a;
for i:=1 to 3 do begin
  for j:=i+1 to 4 do begin
    fillchar(f,sizeof(f),false);
    r:=min(r,q(i,j,1));
  end;
end;
write(r);
end.
